use std::fmt::Display;

fn bubble_sort<T:PartialOrd + Display>(list: &mut Vec<T>) -> &Vec<T>
{
    for _i in 0..list.len()
    {
        for j in 0..list.len() - 1
        {
            if list[j] > list[j+1]
            {
                list.swap(j,j+1)
            }
        }
    }
    
    list
}

fn main()
{
    let mut list1 = vec![1,2,6,7,6,52,50];
    let mut list2 = vec!['a','d','b','f','e','w'];
    bubble_sort(&mut list1);
    println!("{:?}", list1);
    bubble_sort(&mut list2);
    println!("{:?}", list2);
}